<template>
	<view class="page-index">
		<view class="title" style="padding: 0;">车主信息</view>
		<view class="formBox">
			<view class="formTitle">车主姓名</view>
			<view class="formValue"><input type="text" placeholder="请输入车主姓名" class="formInput" v-model="form.username" /></view>
		</view>
		<view class="formBox">
			<view class="formTitle">手机号码</view>
			<view class="formValue"><input type="number" placeholder="请输入车主手机号码" class="formInput" v-model="form.mobile" /></view>
		</view>
		<view class="formBox">
			<view class="formTitle">车牌号码</view>
			<view class="formValue"><input type="text" placeholder="请输入车牌号码" class="formInput" v-model="form.car_number" /></view>
		</view>
		<view class="formBox">
			<view class="formTitle">车架号码</view>
			<view class="formValue"><input type="text" placeholder="请输入车架号码" class="formInput" v-model="form.car_frame" /></view>
		</view>
		<view class="formBox" @click="chooseCar()">
			<view class="formTitle">贴膜车型</view>
			<view class="formValue"><input type="text" placeholder="请选择贴膜车型" class="formInput" disabled v-model="form.car_model" /></view>
		</view>
		<view class="formBox">
			<view class="formTitle">车辆颜色</view>
			<view class="formValue"><input type="text" placeholder="请输入车辆颜色" class="formInput" v-model="form.car_color" /></view>
		</view>
		<view class="title">施工信息</view>
		<view class="formBox">
			<view class="formTitle">
				来店时间
			</view>
			<view class="formValue"><uni-datetime-picker type="datetime" returnType="timestamp" v-model="form.com_time" hide-second /></view>
		</view>
		<view class="formBox">
			<view class="formTitle">
				交付时间
			</view>
			<view class="formValue"><uni-datetime-picker type="datetime" returnType="timestamp" v-model="form.commit_time" hide-second /></view>
		</view>
		<view class="formBox">
			<view class="formTitle">施工技师</view>
			<view class="formValue"><input type="text" placeholder="请输入施工技师" class="formInput" v-model="form.worker" /></view>
		</view>
		<view class="formBox">
			<view class="formTitle">施工单位</view>
			<view class="formValue"><input type="text" placeholder="请输入施工单位" class="formInput" v-model="form.company" /></view>
		</view>
		<view class="title">贴膜信息</view>
		<picker @change="bindPickerChange" :value="index" :range="array" range-key='date'>
			<view class="formBox">
				<view class="formTitle">售后年限</view>
				<view class="formValue"><input type="text" placeholder="请选择售后无忧年限" class="formInput" v-model="form.years" /></view>
			</view>
		</picker>
		<view class="formBox">
			<view class="formTitle">产品品牌</view>
			<view class="formValue"><input type="text" placeholder="请输入产品品牌" class="formInput" v-model="form.brand" /></view>
		</view>
		<view class="formBox">
			<view class="formTitle">产品型号</view>
			<view class="formValue"><input type="text" placeholder="请输入产品型号" class="formInput" v-model="form.model" /></view>
		</view>
		<view class="formBox">
			<view class="formTitle">原车漆受损情况</view>
			<view class="formValue"><input type="text" placeholder="请输入原车漆受损情况" class="formInput" v-model="form.info" /></view>
		</view>
		<view class="formBox">
			<view class="formTitle">车衣施工部位</view>
			<view class="formValue"><input type="text" placeholder="请选择车衣施工部位" class="formInput" v-model="partName.join()" disabled @click="this.$refs.part.open('bottom')" /></view>
		</view>
		<view class="formBox" style="border: none;">
			<view class="formTitle">质保车辆照片</view>
			<view class="formValue"><view class="formTips"></view></view>
		</view>
		<view class="uploadBox">
			<view class="uploadImage" @click="chooseImage()" v-if="form.images.length < 9">
				<image src="/static/home/photo.png" class="photo"></image>
				<!-- <image src="/static/home/photo.png" class="photo"></image> -->
			</view>
			<image :src="item" mode="" v-for="(item, index) in form.images" :key="index" class="images"></image>
		</view>
		<view class="formBox">
			<view class="formTitle">施工价格</view>
			<view class="formValue"><input type="number" placeholder="请输入施工价格" class="formInput" v-model="form.price" /></view>
		</view>
		<view class="formBox">
			<view class="formTitle">备注</view>
			<view class="formValue"><input type="number" placeholder="请输入备注" class="formInput" v-model="form.ps" /></view>
		</view>
		<view class="submit" @click="submit()">
			提交
		</view>
		<uni-popup ref="part" type="bottom" @touchmove.stop.prevent="">
			<scroll-view class="partBox" scroll-y>
				<view class="partItem" v-for="(item, index) in partList" :key="index" @click="partClick(item, index)">
					<view class="">{{ item.name }}</view>
					<uni-icons type="checkmarkempty" size="30" v-if="form.con_part_ids.indexOf(item.id) > -1"></uni-icons>
				</view>
			</scroll-view>
			<view class="close" @click="this.$refs.part.close()">确认</view>
		</uni-popup>
	</view>
</template>

<script src="./page.js"></script>

<style scoped lang="scss">
@import 'page.scss';
</style>
